<?php
include_once("include/include.php.inc");
html_header("Assign Ticket");

/*   $backlink=getenv('HTTP_REFERER');*/

echo "<div class='box'>\n"; 
echo " <div class='boxtop'><div></div></div>\n"; 
echo "  <div class='boxcontent'>\n"; 


   $result = mysql_query( "SELECT tic_no, tic_user, tic_ip, DATE_FORMAT(tic_date,'%d/%m/%y') AS mtic_date, DATE_FORMAT(tic_time,'%T') AS mtic_time, tic_problem FROM chd_tickets WHERE tic_status='O' AND tic_sup_name=''")
           or die("SELECT Error: ".mysql_error());

           $num_rows = mysql_num_rows($result);

           print "<TABLE width=\"100%\" bgcolor=\"#336699\" BORDER=\"0\" bordercolor=\"#FFFFFF\"><tr>";
           print "<th width=\"11%\" scope=\"col\"><span class=\"style6\">Ticket#</span></th>";
		   print "<th width=\"18%\" scope=\"col\"><span class=\"style6\">User</span></th>";
		   print "<th width=\"10%\" scope=\"col\"><span class=\"style6\">Date</span></th>";
		   print "<th width=\"10%\" scope=\"col\"><span class=\"style6\">IP</span></th>";
		   print "<th width=\"44%\" scope=\"col\"><span class=\"style6\">Problem</span></th>";
		   print "<th width=\"3%\" scope=\"col\">&nbsp;</th></tr>";

           while ($row = mysql_fetch_assoc($result)){
                 extract($row);
	         	 print "<tr><td bgcolor=\"#FFFFFF\" scope=\"col\"><span class=\"style8\">$tic_no</span></td>";
                 print "<td bgcolor=\"#FFFFFF\" scope=\"col\"><div align=\"left\"><span class=\"style8\">$tic_user</span></div></td>";
                 print "<td bgcolor=\"#FFFFFF\" scope=\"col\"><span class=\"style8\">$mtic_date-$mtic_time</span></td>";
                 print "<td bgcolor=\"#FFFFFF\" scope=\"col\"><span class=\"style8\">$tic_ip</span></td>";
                 print "<td bgcolor=\"#FFFFFF\" scope=\"col\"><div align=\"left\"><span class=\"style8\">$tic_problem</span></div></td>";
                 /*print "<td><a href=\"edit_ticket.php?cmd=edit&tic_no=$tic_no\"><IMG src=\"../images/edit.gif\"></a></td>";*/
                 print "<td bgcolor=\"#FFFFFF\" scope=\"col\"><span class=\"style8\"><a href=\"asg_ticket.php?cmd=asg&tic_no=$tic_no\"><IMG src=\"css/images/assign.gif\"></a></span></td></tr>";
                 }

                 print "</table>\n";
                 print "<br>";print "<br>";
				
   print "</form>";
   
echo "  </div>\n"; 
echo " <div class='boxbottom'><div></div></div>\n"; 
echo "</div>\n"; 
echo "\n";
  html_footer();
?>